package com.endava.spring.dao_interface;

import java.util.List;

import com.endava.spring.beans.Account;

/**
 * Interface used for basic operations in Data Base: CRUD (Create, Read, Update,
 * Delete).
 * 
 * @author acojocar
 * @since 30.07.2013
 * @version 1.0
 * 
 */
public interface AccountDao {

	/**
	 * Queries used for Data Base operations.
	 */
	public static final String INSERT_QUERY = "INSERT INTO account VALUES(?, ?, ?);";
	public static final String SELECT_ALL_QUERY = "SELECT * FROM account;";
	public static final String DELETE_QUERY = "DELETE FROM account WHERE id_account = ?;";
	public static final String UPDATE_QUERY = "UPDATE account SET amount = ? WHERE id_account = ?;";

	/**
	 * Creates a new entry of <code>Account</code> model in Data Base.
	 * 
	 * @param accountID
	 *            the ID of account
	 * @param accountType
	 *            the type of account
	 * @param amount
	 *            the amount of account
	 */
	public void create(Integer accountID, String accountType, Integer amount);

	/**
	 * Gets all accounts from Data Base.
	 * 
	 * @return a list with accounts from Data Base
	 */
	public List<Account> getAllAccounts();

	/**
	 * Delete account from Data Base, by ID.
	 * 
	 * @param accountID
	 *            the ID of account
	 */
	public void delete(Integer accountID);

	/**
	 * Updates the value of amount, of a certain account.
	 * 
	 * @param accountID
	 *            the ID of account
	 * @param amount
	 *            the amount of account
	 */
	public void update(Integer accountID, Integer amount);

}
